<script lang='ts' setup>
import { reactive,onMounted,ref} from 'vue'

const state = reactive({
	dialogTitle: '',
    tableData: [
		{
			id: 1, 
			name: 'TOM',  
			phone: '15502336548', 
			address: '陕西省西安市雅塔区',
			default: false,
		}
	] as Array<any>,
    rowId: 0
})

const props = withDefaults(defineProps<{
    modelValue: boolean,
}>(), {
	modelValue: false
})

const emit = defineEmits(['update:modelValue'])

const closeDialog = () => {
    emit('update:modelValue', false)
}

const previewInfo = (row: any) => {
   
}


</script>

<template>
    <main>
        <el-dialog v-model="props.modelValue" :title="`收货地址列表`" @close="closeDialog" style="width: 1300px;" center>
            <el-table :data="state.tableData" style="width: 100%">
				<el-table-column label="收货人" prop="name" />
				<el-table-column label="联系方式" prop="phone" />
				<el-table-column label="收货地址" prop="address" />
				<el-table-column label="是否为默认收货地址" prop="de">
					<template #default="scope">
						<el-switch v-model="scope.row.default" />
					</template>
				</el-table-column>
				<el-table-column label="操作">
					<template #default="scope">
						<el-link :underline="false" type="primary" @click="previewInfo(scope.row)">选择改地址</el-link>
					</template>
				</el-table-column>
				
			</el-table>
        </el-dialog> 
    </main>
</template>

<style lang='scss' scoped>

</style>